package com.xzh.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xzh.model.Courses;
import com.xzh.model.Students;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface EchartsMapper extends BaseMapper<Courses> {

    default List<Map<String, Object>> statistics(){
        QueryWrapper<Courses> qw = new QueryWrapper<>();
        qw.select("course_type", "COUNT(*) as count")
                .groupBy("course_type");
        return selectMaps(qw);
    }

}
